#define _CRT_SECURE_NO_WARNINGS 1

class SeatManager {
private:
    priority_queue<int, deque<int>, greater<int>> _sit;
public:
    SeatManager(int n) {
        for (int i = 1; i <= n; i++)
        {
            _sit.push(i);
        }
    }

    int reserve() {
        int ret = _sit.top();
        _sit.pop();
        return ret;
    }

    void unreserve(int seatNumber) {
        _sit.push(seatNumber);
    }
};

/**
 * Your SeatManager object will be instantiated and called as such:
 * SeatManager* obj = new SeatManager(n);
 * int param_1 = obj->reserve();
 * obj->unreserve(seatNumber);
 */